import React from "react";
import { withRouter } from "react-router-dom";
import PropTypes from 'prop-types';

import { NavBar } from 'antd-mobile';
import style from './index.module.scss'

function HeadNavBar ({children, history}) {
  return (
    <NavBar
      mode="light"
      icon={<i className="iconfont icon-back"/>}
      onClick={() => history.goBack()}
      className={style.navBar}
    >{children}</NavBar>
  )
}

HeadNavBar.propTypes = {
  children: PropTypes.string
};

export default withRouter(HeadNavBar)
